home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
426-450
/
disk_436
/
input
/
console.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
1KB
|
52 lines
/*******************************
* CONSOLE 08/04/90
* Written by Timm Martin
* This code is public domain.
********************************/
#include <devices/console.h>
#include <exec/devices.h>
#include <exec/types.h>
#include <functions.h>
#include "input.h"
struct Device *ConsoleDevice = NULL;
struct IOStdReq ConsoleReq;
long ConsoleError = TRUE;
/****************
* CONSOLE OPEN
*****************/
/*
This function attempts to open the console device. TRUE or FALSE is returned
whether it was successful.
*/
BOOL console_open( void )
{
if (!(ConsoleError = OpenDevice( "console.device", -1L,
(struct IORequest *)&ConsoleReq, NULL )))
ConsoleDevice = ConsoleReq.io_Device;
return (ConsoleError == FALSE);
}
/*****************
* CONSOLE CLOSE
******************/
/*
This procedure closes the console device if it was opened and resets the
corresponding pointers.
*/
void console_close( void )
{
if (!ConsoleDevice)
{
CloseDevice( (struct IORequest *)&ConsoleReq );
ConsoleDevice = NULL;
}
}